package com.bootdo.system.config;


 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;

 import org.springframework.core.convert.converter.Converter;
 import org.springframework.stereotype.Component;

/**
 * All rights Reserved, Designed By liuxiaolong 
 * @Title: CustomDateConverter
 * @Package com.bootdo.system.config
 * @Description: (用一句话描述该文件做什么)
 * @author: liuxiaolong
 * @date: 2021/3/6 23:09 
 * @version V1.0
 */
@Component
public class CustomDateConverter implements Converter<String, Date>  {

    @Override
    public Date convert(String source) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmm");
        try {
            return simpleDateFormat.parse(source);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }

}

